<?php

class ZFKiller_Form extends Zend_Form {
	const GET_VALUE_TYPE_DB = 'db';
	const GET_VALUE_TYPE_DEFAULT = 'default';
	const GET_VALUE_TYPE_USER = 'user';

	public static $getValueType = null;
	
	public function __construct($options = null) {
		parent::__construct($options);
		
		$this
				->addElementPrefixPath('ZFKiller_Form_Decorator', PATH_ZFEXTEND . '/ZFKiller/Form/Decorator', Zend_Form::DECORATOR)
				->setMethod(Zend_Form::METHOD_POST)
				->addClass('zfrm')
		;
	}
	
	public function addClass($classname) {
		$this->setAttrib('class', trim($this->getAttrib('class') . ' ' . $classname));
		return $this;
	}

	public function getValue($name, $getValueType=self::GET_VALUE_TYPE_DEFAULT) {
		self::$getValueType = $getValueType;
		return parent::getValue($name);
	}

	public function getValues($getValueType=self::GET_VALUE_TYPE_DEFAULT) {
		self::setGetValueType($getValueType);
		$values = parent::getValues();
		self::setGetValueType();
		return $values;
	}

	public static function getValueType() {
		return self::$getValueType;
	}

	public static function setGetValueType($getValueType=self::GET_VALUE_TYPE_DEFAULT) {
		self::$getValueType = $getValueType;
	}

}